package cn.tedu.mintmall.dto;

import cn.tedu.mintmall.constant.RewRegExpression;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel(value = "新增奖赏DTO")
public class RewardAddNewDTO implements Serializable {

    /**
     * 验证请求参数失败的描述文本前缀
     */
    private static final String VALIDATE_MESSAGE_PREFIX = "新增奖赏失败，";

    @NotNull(message = "添加奖赏失败, 请提交奖赏名")
    @ApiModelProperty(name = "name", value = "奖赏名", required = true, dataType = "string")
    @Pattern(regexp = RewRegExpression.REGEXP_NAME,message = VALIDATE_MESSAGE_PREFIX + RewRegExpression.MESSAGE_NAME)
    private String name; // 奖赏名

    @NotNull(message = "添加奖赏失败, 请提交奖赏内容")
    @ApiModelProperty(name = "content", value = "奖赏内容", required = true, dataType = "string")
    @Pattern(regexp = RewRegExpression.REGEXP_CONTENT,message = VALIDATE_MESSAGE_PREFIX + RewRegExpression.MESSAGE_CONTENT)
    private String content; // 奖赏内容

    @NotNull(message = "添加奖赏失败, 请提交奖赏数量")
    @ApiModelProperty(name = "amount", value = "奖赏数量", required = true, dataType = "double")
    private Double amount; // 奖赏数量

    @NotNull(message = "添加奖赏失败, 请提交奖赏用户名")
    @ApiModelProperty(name = "user", value = "奖赏用户名", required = true, dataType = "string")
    private String user; // 奖赏用户名

}
